package o;

import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.atomic.AtomicBoolean;

public class dmr implements Runnable, Comparable<dmr> {
    private dmn ʻ = dmn.NORMAL;
    private dmi ˊ;
    private final AtomicBoolean ˋ = new AtomicBoolean(false);
    private int ˎ;
    private dmp ˏ = null;
    private volatile a ॱ = a.PENDING;

    public enum a {
        PENDING,
        RUNNING,
        FINISHED
    }

    public /* synthetic */ int compareTo(Object obj) {
        return ˏ((dmr) obj);
    }

    public dmr(dmp o_dmp, dmn o_dmn, dmi o_dmi) {
        this.ˏ = o_dmp;
        this.ʻ = o_dmn;
        this.ˊ = o_dmi;
    }

    protected void ˊ(int i) {
        this.ˎ = i;
    }

    public final int ˏ(dmr o_dmr) {
        if (this.ʻ.ˋ() > o_dmr.ʻ.ˋ()) {
            return -1;
        }
        if (this.ʻ.ˋ() < o_dmr.ʻ.ˋ()) {
            return 1;
        }
        if (this.ˎ < o_dmr.ˎ) {
            return -1;
        }
        if (this.ˎ > o_dmr.ˎ) {
            return 1;
        }
        return 0;
    }

    public boolean equals(Object obj) {
        return super.equals(obj);
    }

    public int hashCode() {
        return super.hashCode();
    }

    private void ˋ() {
    }

    public final void run() {
        this.ˊ.run();
        this.ॱ = a.FINISHED;
        if (ˏ()) {
            ˋ();
        }
    }

    protected dmi ॱ() {
        return this.ˊ;
    }

    protected dmp ˊ() {
        return this.ˏ;
    }

    protected final void ˏ(ThreadPoolExecutor threadPoolExecutor) {
        if (this.ॱ != a.PENDING) {
            switch (this.ॱ) {
                case RUNNING:
                    Logger.e("DispatchWorkItem", "Cannot execute task: the task is already running.");
                    return;
                case FINISHED:
                    Logger.e("DispatchWorkItem", "Cannot execute task: the task has already been executed (a task can be executed only once)");
                    return;
                default:
                    return;
            }
        }
        this.ॱ = a.RUNNING;
        threadPoolExecutor.execute(this);
    }

    public boolean ˏ() {
        return this.ˋ.get();
    }
}
